/*
From Wood & Hoy (2020) “Helping us or helping them? What makes foreign aid 
popular with donor publics?”, Economic Development and Cultural Change

Creates Tables in online appendix.
*/

***APPENDIX 1 Balance Table***

//Note: some subsequent modification required in excel
label var D1b_City "Urban"
label var D2_Atleast50 "Aged 50 and over" 
label var D3_Male "Male"
label var D4_Uni "Academic education"
label var Incomepc "Income"

iebaltab D1b_City D2_Atleast50 D3_Male D4_Uni Incomepc, ///
grpvar(HQGROUP) rowvarlabels order(5 1 2 3 4) save(Append1_Bal_Tab) replace


***APPENDIX 4 -- Logit regressions with and without controls
//Create four binary variables. In these all treatment groups go to missing 
//except people in the treatment group of interest and those in control. 

//In first all respondents go to missing unless they are in control (0)
//or National interest treatment (1)
gen Self_Con =.
replace Self_Con = 0 if HQGROUP==5
replace Self_Con = 1 if HQGROUP==3


//In first all respondents go to missing unless they are in control (0)
//or in help poor countries treatment (1)
gen Alt_Con =.
replace Alt_Con = 0 if HQGROUP==5
replace Alt_Con = 1 if HQGROUP==2


//In first all respondents go to missing unless they are in control (0)
//or in Global leader treatment (1)
gen Glob_Con =.
replace Glob_Con = 0 if HQGROUP==5
replace Glob_Con = 1 if HQGROUP==4

//In first all respondents go to missing unless they are in control (0)
//or in basic treatment (1)
gen Pl_Con =.
replace Pl_Con = 0 if HQGROUP==5
replace Pl_Con = 1 if HQGROUP==1


label var Alt_Con "Help others"
label var Self_Con "National interest"
label var Glob_Con "Global leader"
label var Pl_Con "Basic treatment"
label var Q3_up "Too little"
label var Q3_down "Too much"

// Table A2-A4: comparisons of treatments to control group
estimates clear

foreach treatment in  Pl_Con Self_Con Alt_Con Glob_Con {
	qui: logit Q3_up i.`treatment'
	estimates store little_basic, title(Too little)
	qui: logit Q3_up i.`treatment' D1b_City D2_Atleast50 D3_Male D4_Uni Incomepc
	estimates store little_full, title(Too little)
		
	qui: logit Q3_down i.`treatment'
	estimates store much_basic, title(Too Much)
	qui: logit Q3_down i.`treatment' D1b_City D2_Atleast50 D3_Male D4_Uni Incomepc
	estimates store much_full, title(Too Much)
		
	esttab little_basic little_full much_basic much_full using App4_logit_to_control.rtf, ///
	append mtitle label b(2) se(2) varwidth(30) ///
	title(`: variable label `treatment'' compared to control (Logit)) ///
	star(* 0.10 ** 0.05 *** 0.01) nobase nonumbers nogaps
}
	
// Table A6-A8: comparisons of treatments to basic treatment

//Create three binary variables. In these all treatment groups go to missing 
//except people in the treatment group of interest and the basic treatment group. 

//In first all respondents go to missing unless they are in basic treatment (0)
//or National interest treatment (1)
gen Self_Pl =.
replace Self_Pl = 0 if HQGROUP==1
replace Self_Pl = 1 if HQGROUP==3
label var Self_Pl "National interest"

//In first all respondents go to missing unless they are in basic treatment (0)
//or in help poor countries treatment (1)
gen Alt_Pl =.
replace Alt_Pl = 0 if HQGROUP==1
replace Alt_Pl = 1 if HQGROUP==2
label var Alt_Pl "Help others"

//In first all respondents go to missing unless they are in basic treatment (0)
//or in Global leader treatment (1)
gen Glob_Pl =.
replace Glob_Pl = 0 if HQGROUP==1
replace Glob_Pl = 1 if HQGROUP==4
label var Glob_Pl "Global leader"

estimates clear

foreach treatment in  Self_Pl Alt_Pl Glob_Pl {
	qui: logit Q3_up i.`treatment'
	estimates store little_basic, title(Too little)
	qui: logit Q3_up i.`treatment' D1b_City D2_Atleast50 D3_Male D4_Uni Incomepc
	estimates store little_full, title(Too little)
		
	qui: logit Q3_down i.`treatment'
	estimates store much_basic, title(Too Much)
	qui: logit Q3_down i.`treatment' D1b_City D2_Atleast50 D3_Male D4_Uni Incomepc
	estimates store much_full, title(Too Much)
		
	esttab little_basic little_full much_basic much_full using App4_logit_to_basic.rtf, ///
	append mtitle label b(2) se(2) varwidth(30) ///
	title(`: variable label `treatment'' compared to basic treatment (Logit)) ///
	star(* 0.10 ** 0.05 *** 0.01) nobase nonumbers nogaps
}
	//

***APPENDIX 4 - Tables A9-A10 Factual Manipulation Checks
	
label var attention "Could name both diseases"

// Compare to control
estimates clear
reg Q3_up ib5.HQGROUP if attention==1
estimates store little, title(Too little)
reg Q3_down ib5.HQGROUP if attention==1
estimates store much, title(Too much)

esttab little much using App4_FMC_cont_basic.rtf, replace ///
mtitle label b(2) se(2) varwidth(30) ///
title(Difference from control amongst those who passed factual manipulation check) ///
star(* 0.10 ** 0.05 *** 0.01) nobase nonumbers noconstant nogaps

// Compare to basic treatment
estimates clear
reg Q3_up i.HQGROUP if attention==1 & HQGROUP!=5
estimates store little, title(Too little)
reg Q3_down i.HQGROUP if attention==1 & HQGROUP!=5
estimates store much, title(Too much)

esttab little much using App4_FMC_cont_basic.rtf, append ///
mtitle label b(2) se(2) varwidth(30) ///
title(Difference from basic treatment amongst those who passed factual manipulation check) ///
star(* 0.10 ** 0.05 *** 0.01) nobase nonumbers noconstant nogaps


***APPENDIX 4 - Tables A11&12 exclude spent less than 15 seconds reading survey

//Create binary denoting if people read the article too quickly
gen too_quick = .
replace too_quick = 1 if time_on_article < 15 
replace too_quick = 0 if time_on_article >= 15

// Compare to control
estimates clear
reg Q3_up ib5.HQGROUP if too_quick==0
estimates store little, title(Too little)
reg Q3_down ib5.HQGROUP if too_quick==0
estimates store much, title(Too much)

esttab little much using App4_too_quick_cont_basic.rtf, replace ///
mtitle label b(2) se(2) varwidth(30) ///
title(Difference from control amongst those who took sufficient time to read article) ///
star(* 0.10 ** 0.05 *** 0.01) nobase nonumbers noconstant nogaps

estimates clear

// Compare to Basic Treatment
estimates clear
reg Q3_up i.HQGROUP if too_quick==0
estimates store little, title(Too little)
reg Q3_down i.HQGROUP if too_quick==0
estimates store much, title(Too much)

esttab little much using App4_too_quick_cont_basic.rtf, append ///
mtitle label b(2) se(2) varwidth(30) ///
title(Difference from basic treatment amongst those who took sufficient time to read article) ///
star(* 0.10 ** 0.05 *** 0.01) nobase nonumbers noconstant nogaps

estimates clear
drop too_quick


****APPENDIX 4 -- A13&14 Exclude fastest and slowest deciles in completing survey

	
// Compare to control
estimates clear
reg Q3_up ib5.HQGROUP if Time_10_90==1
estimates store little, title(Too little)
reg Q3_down ib5.HQGROUP if Time_10_90==1
estimates store much, title(Too much)

esttab little much using App4_windsor.rtf, replace ///
mtitle label b(2) se(2) varwidth(30) ///
title(Difference from control excluding fastest and slowest deciles in completing survey) ///
star(* 0.10 ** 0.05 *** 0.01) nobase nonumbers noconstant nogaps

estimates clear

// Compare to basic treatment
estimates clear
reg Q3_up i.HQGROUP if Time_10_90==1
estimates store little, title(Too little)
reg Q3_down i.HQGROUP if Time_10_90==1
estimates store much, title(Too much)

esttab little much using App4_windsor.rtf, append ///
mtitle label b(2) se(2) varwidth(30) ///
title(Difference from basic treatment excluding fastest and slowest deciles in completing survey) ///
star(* 0.10 ** 0.05 *** 0.01) nobase nonumbers noconstant nogaps

estimates clear

drop Alt_Con Self_Con Glob_Con Pl_Con Self_Pl Alt_Pl Glob_Pl
